# $Id$
# Maintainer: Andrea Scarpino <andrea@archlinux.org>
# Contributor: nesl247 <nesl247@gmail.com>

pkgbase=pycups
pkgname=('python2-pycups' 'python-pycups')
pkgver=1.9.73
pkgrel=4
arch=('x86_64')
url="http://cyberelk.net/tim/software/pycups/"
license=('GPL')
makedepends=('libcups' 'python2' 'python')
source=(http://cyberelk.net/tim/data/${pkgbase}/${pkgbase}-${pkgver}.tar.bz2{,.asc})
# md5sum: https://pypi.python.org/pypi/pycups
md5sums=('ee0e7204d7a2ae942e2f4c4508afdbfb'
         'SKIP')
validpgpkeys=('02EA6349CE58E1BCAA8514F57955128DA3A1ABD3'  # Tim Waugh
              '4629AFE960EC20BEC12E3104B7C20D079491EA63') # Tim Waugh <twaugh@redhat.com>

prepare() {
  cp -a ${pkgbase}-${pkgver} ${pkgbase}-${pkgver}-python2
}

build() {
  cd ${pkgbase}-${pkgver}
  python setup.py build
  cd "${srcdir}"/${pkgbase}-${pkgver}-python2
  python2 setup.py build
}

package_python2-pycups() {
  pkgdesc="Python 2 CUPS Bindings"
  depends=('libcups' 'python2')

  cd ${pkgbase}-${pkgver}-python2
  python2 setup.py install --root="${pkgdir}" --optimize=1
}

package_python-pycups() {
  pkgdesc="Python 3 CUPS Bindings"
  depends=('libcups' 'python')

  cd ${pkgbase}-${pkgver}
  python setup.py install --root="${pkgdir}" --optimize=1
}
